package com.young.api;

import com.young.service.DubboTestService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 测试dubbo
 * @Author: kangyang
 * @Date: 2021/5/21 14:45
 **/
@RestController
public class DubboTestController {

  @Reference
  private DubboTestService dubboTestService;

  @GetMapping("/rpc/test")
  public ResponseEntity testDubbo() {
    String sayHello = dubboTestService.sayHello();
    System.out.println(sayHello + "--------ok----------");
    return ResponseEntity.ok().build();
  }

}
